package com.eazy.lkv2.web.controller.system.count;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eazy.lkv2.core.web.utils.ResultVO;
import com.eazy.lkv2.web.controller.BaseController;
import com.eazy.lkv2.web.entity.LoginLog;
import com.eazy.lkv2.web.service.system.count.BaiduService;

/**
 * 集成百度地图
 */
@Controller
@RequestMapping("/baidu")
public class CountBaiduController extends BaseController<Object,Integer> {

	@Autowired
	private BaiduService baiduService;

	@RequestMapping(value = "list", method = RequestMethod.GET)
	public String list() {
		return "/sys/baidu_log";
	}

	@RequestMapping(value = "getLocations", method = RequestMethod.GET)
	public void getLocations() {
		ResultVO resultVO = new ResultVO(true);
		List<LoginLog> result = baiduService.queryByList(null);
		resultVO.setData(baiduService.getLocationsBiz(result));
		renderJson(resultVO);
	}
}
